<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="/css/admin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
	.longtxt{width:300px;}
</style>
<script src="/js/jquery-1.5.1.min.js" language="javascript" type="text/javascript"></script>
<script type="text/javascript">
	$(function () {
		var rolelevel = '<?=$rolelevel?>';		
		if(rolelevel == '0'){
			$("#radio0").attr("checked","true");
		}
		else if(rolelevel == '1'){
			$("#radio1").attr("checked","true");
		}
		else if(rolelevel == '2'){
			$("#radio2").attr("checked","true");
		}
	});
	function VerifyPage(){
		if($("#rolename").val() == ''){
			alert('角色名称不能为空!');
			return false;
		}
		return true;
	}
	function chooseSite(){
		window.open('/cms/choosesite','请选择网站','width=350,height=300,left=' + (screen.availWidth - 350) / 2 + ',top=' + (screen.availHeight - 300) / 2);
	}
	function setSite(parm){		
		var ary = parm.split('|');
		if(ary.length == 2){
			var sid = ary[0];
			var sname = ary[1];
			$("#sname").val(sname);
			$("#sid").val(sid);
		}
	}
</script>
</head>
<body>
<form name="form1" action="/cms/saverole" method="post" onSubmit="return VerifyPage();">
<input type="hidden" name="roleid" value="<?=$roleid ?>" />
<div class="listTitle">编辑角色</div>
<div>
<table cellpadding="5">
<tr><td>角色名称</td><td><input type="text" class="longtxt" id="rolename" name="rolename" value="<?=$rolename?>" /></td></tr>
<tr><td>描述</td><td><input type="text" class="longtxt" id="descr" name="descr" value="<?=$descr?>" /></td></tr>
<tr><td>所属网站</td><td><input type="text" class="longtxt" id="sname" name="sname" value="<?=$sname?>" /><input type="hidden" id="sid" name="sid" value="<?=$sid?>" /><input type="button" value="..." onclick="chooseSite()" /></td></tr>
<tr><td>权限</td><td><input type="radio" id="radio0" name="rolelevel" value="0" checked />编辑文档&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" id="radio1" name="rolelevel" value="1" />审核文档&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" id="radio2" name="rolelevel" value="2" />全部</td></tr>
<tr><td></td><td><input type="submit" value=" 保存 " />&nbsp;&nbsp;<input type="button" value="取消" onclick="window.location='/cms/roles'"/></td></tr>
</table>
</div>
</form>
</body>
</html>